package com.atmk.atmk.designMode.创建型.工厂模式.简单工厂;

public class Main {
    public static void main(String[] args) {
        ShapeFactory factory = new ShapeFactory();

        Shape rectangle = factory.createShape("Rectangle");
        if (rectangle != null) {
            rectangle.draw();  // Output: Drawing a rectangle
        }

        Shape circle = factory.createShape("Circle");
        if (circle != null) {
            circle.draw();  // Output: Drawing a circle
        }
    }
}
